package com.hxzy.service.impl;

import com.hxzy.dto.HouseFeatureSearchDTO;
import com.hxzy.entity.HouseFeature;
import com.hxzy.mapper.HouseFeatureMapper;
import com.hxzy.service.HouseFeatureService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;


@Transactional(rollbackFor = Exception.class)
@Service
public class HouseFeatureServiceImpl extends CommonServiceImpl<HouseFeature, Integer> implements HouseFeatureService {

    private HouseFeatureMapper houseFeatureMapper;

    @Autowired
    public void setFeatureMapper(HouseFeatureMapper houseFeatureMapper){
        this.houseFeatureMapper = houseFeatureMapper;
        super.setMyBatisBaseDao(houseFeatureMapper);
    }

    @Override
    public List<HouseFeature> search(HouseFeatureSearchDTO houseFeatureSearchDTO) {
        return this.houseFeatureMapper.search(houseFeatureSearchDTO);
    }

    @Override
    public int existsName(Integer id, String name) {
        return this.houseFeatureMapper.existsName(id, name);
    }
}
